home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Especial Multimedia
/
Especial Multimedia.iso
/
Multimed
/
Presenta
/
FORMDEMO.ZIP
/
BALL.SX_
/
BALL.SX
Wrap
Text File
|
1997-09-14
|
527b
|
19 lines
///////////////////////////////
// Color ball sprite handler
init: name, xpos, ypos, xmov, ymov
load $name bitmap bmp palette pal
compose palette pal
remap bitmap bmp palette pal
ball = new sprite
xlen,ylen = bmp.dim[1]/2,bmp.dim[0]/2
show:
sprite ball bitmap bmp trans 0,255,0 at xpos-xlen,ypos-ylen depth ypos
xpos = xpos + xmov
ypos = ypos + ymov
if xpos < 0 then xmov = -xmov
if ypos < 0 then ymov = -ymov
if xpos > GRAPHICS_XMAX then xmov = -xmov
if ypos > GRAPHICS_YMAX then ymov = -ymov